<html>
    <head>
        <title>form md5</title>
        <script src="https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.18.0/js/md5.js"></script>
    </head>
    <body>
        <form action='https://www.baidu.com' method="post"  >
            <p><span>请输入用户名</span>
                <input type='text' id='username' name='username'></p>
            <p><span>请输入密码</span>
                <!--去掉它的name属性，这样提交表单的时候就不会带上这个inputPassword，只让它
                    接受用户在密码框里输入的密码而已，而真正会被传到后台的密码会在隐藏框里，
                    这样很安全-->
                <input type='password' id='inputPassword' ></p> 
            <p><span>请输入密码</span>
                <input type='hidden' id='password' name='password'></p>

            <button type="submit" onclick='return aaa()'>提交</button>
        </form>
        <script>
            var myVar = {};
            function aaa() {
                alert(1);
                //MD5加密
                myVar.uname = document.getElementById('username');
                myVar.iPwd = document.getElementById('inputPassword');
                myVar.pwd = document.getElementById('password');
                myVar.pwd.value = md5(myVar.iPwd.value);
                return true;
                //return false;
            }
        </script>
    </body>
</html>